import 'package:flutter/material.dart';
import 'package:get/get.dart';

class SubmitAlertDialog extends StatefulWidget {
  SubmitAlertDialog({
    Key? key,
    required this.reminder,
    required this.message,
    this.submitAnswers,
  }) : super(key: key);
  final String reminder;
  final String message;
  final Function()? submitAnswers;

  @override
  State<SubmitAlertDialog> createState() => _DeleteFolderDialogState();
}

class _DeleteFolderDialogState extends State<SubmitAlertDialog> {
  String? folderId;
  String? folderName;
  @override
  Widget build(BuildContext context) {
    return AlertDialog(
      backgroundColor: Get.isDarkMode
          ? (Color(0xff333333))
          : Color.fromARGB(255, 234, 241, 238),
      shape: RoundedRectangleBorder(
          borderRadius: BorderRadius.all(Radius.circular(20))),
      content: Container(
        height: 200,
        width: MediaQuery.of(context).size.width > 500
            ? 500
            : MediaQuery.of(context).size.width,
        child: Column(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [
            Expanded(
                child: Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                  Text(widget.message,
                      style: TextStyle(
                          color: Get.isDarkMode
                              ? Color(0xffcccccc)
                              : Colors.black)),
                  SizedBox(height: 20),
                  Text(this.widget.reminder,
                      style: TextStyle(
                          fontWeight: FontWeight.bold,
                          letterSpacing: 1,
                          color:
                              Get.isDarkMode ? Color(0xffcccccc) : Colors.black,
                          fontSize: 20)),
                ])),
            Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                MaterialButton(
                    color:
                        Get.isDarkMode ? (Color(0xff444444)) : (Colors.white),
                    textColor: Get.isDarkMode
                        ? (Color(0xffcccccc))
                        : Theme.of(context).primaryColorDark,
                    onPressed: () {
                      Navigator.of(context).pop();
                    },
                    child: Text('Close'.tr)),
                MaterialButton(
                    color: Get.isDarkMode
                        ? (Colors.white)
                        : Theme.of(context).primaryColorDark,
                    textColor: Get.isDarkMode
                        ? (Colors.black)
                        : Theme.of(context).primaryColorLight,
                    onPressed: () {
                      widget.submitAnswers!();
                    },
                    child: Text('Submit'.tr))
              ],
            ),
          ],
        ),
      ),
    );
  }
}
